1. Field of the Invention
The present invention relates to the time control and timing service of a computer system. It especially relates to the timer adjusting system that performs the time adjustment between the processors in a multi-processor system.
2. Description of the Related Art
A microprocessor generally has a timer (TICK) that is updated by the operation clock of a processor. There are many cases that this timer is used for time-of-day clocking and timing service of a computer system.
Today""s mission-critical computer systems are usually large scale, multi-processor systems carrying fair number of processors. In such large scale multi-processor systems, there are many cases that the whole system is divided into a plurality of partitions, and each partition is actuated as a symmetric multi-processor (SMP) system. In a symmetric multi-processors system, all the processors share work loads in unit called a process, communicating through the main storage shared over the processors.
In such a system, it is required that the time of day clocked in each processor partition should be same in fair accuracy. If the time of day in the processors are not same, there could be the cases in which the execution sequence of the processes cannot be maintained properly over their migration between processors. This causes a problem for the work loads that use the time of day in each processor to synchronize the processes.
Therefore, in a conventional multi-processor system, an apparatus for adjusting the timer value (TICK value) of the processors in a partition is adapted. For example, there is a software-based time, in that the TICK value is read out from a certain processor, and the value is sent to another processor in the same partition via a main storage. Then, the processor that receives the TICK value adjusts the time by writing the value in its own TICK.
In the above-mentioned conventional time adjustment method, however, there are following problems:
One of the problems in the adjustment comes from the operating frequency of microprocessors which has been brought more than a GHz by the advancement in semiconductor technology and processor design technology. With such high operating frequency, the time in processor cycles required for the transfer of the TICK value via main storage becomes long and cannot be ignored in the symmetric multi-processors system.
In the prior art, however, this transfer time was not measured, and the time adjustment was performed ignoring the influence of the transfer time. Therefore, the possibility for the error of the time between processors caused by the transfer of a TICK value influence the order, etc. of processes becomes higher, as the operation frequency increases.
It is an object of the present invention to provide a software-oriented timer adjusting system that accurately performs the time adjustment between processors in a multi-processors system with some hardware assist.
At the first aspect of the present invention, the timer adjusting system is provided with a generating circuit, an out put circuit, an input circuit, a measuring circuit, and a synchronizing circuit. The system adjusts the time of a plurality of processors in a multi-processor system.
The generating circuit generates a time synchronous signal which indicates certain synchronous events. The output circuit outputs the time synchronous signal. The input circuit inputs the time synchronous signal that is output from the output circuit and travels through the part of timer adjusting system provided in the system and returns to the input circuit of the processor.
The measuring circuit measures the travel time of the time synchronous signal through the timer adjusting system. The synchronizing circuit adjusts time information of one or more timers of a plurality of processors using the measured period of time as a period of time for propagating the time synchronous signal between two processors in the multi-processor system, and synchronizes the timers of these processors.
At the second aspect of the present invention, the timer adjusting system is provided with a generating circuit, an output circuit, an input circuit, a measuring circuit, a synchronizing circuit, and a distributing circuit. The system adjusts the time of a plurality of processors in a multi-processor system. The generating circuit, output circuit, and input circuit are provided with each of a plurality of processors.
The generating circuit generates a time synchronous signal in the multi-processor system. The output circuit outputs the time synchronous signal as a synchronous output, and the input circuit inputs a synchronous input. The distributing circuit generates a logical OR signal of a plurality of synchronous outputs that are output from a plurality of processors, and distributes the logical OR signal to the plurality of processors as a synchronous input.
The measuring circuit measures a period of time while one of the plurality of processors outputs a synchronous output and receives a synchronous input. The synchronizing circuit corrects time information of one or more timers of a plurality of processors, using the measured period of time as a period of time for propagating the logical OR signal, and synchronize the timers of the plurality of processors.